/*
 * DxfPOINT.java
 *
 * Created on 6 de Dezembro de 2007, 10:33
 * 
 * Modified on 10 de Agosto de 2011, 14:31 by Adriano
 * Included the attributes @Override to inherented methods
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package importadorDXF;

import mathematics.Point3D;

/**
 *
 * @author rafaelbuck
 * @author Adriano Ferreira
 * 
 */
public class DxfPOINT extends DxfEntity
{
    @Override
    public boolean setGroup(short grpNr, float fval)
    {
        switch(grpNr)
        {
        case 10: // '\n'
        case 20: // '\024'
        case 30: // '\036'
            setCoord(position, grpNr / 10, fval);
            return true;

        case 50: // '2'
            flatDir = (float)(((double)fval / 180D) * 3.1415926535897931D);
            return true;
        }
        return super.setGroup(grpNr, fval);
    }

    @Override
    public void convert(DxfConverter converter, DxfFile dxf, Object collector)
    {
        converter.convert(this, dxf, collector);
    }

    public final Point3D getPosition()
    {
        return position;
    }

    public float getXDirection()
    {
        return flatDir;
    }

    /** Creates a new instance of DxfPOINT */
    public DxfPOINT()
    {
        position = new Point3D();
    }

    protected Point3D position;
    protected float flatDir;
}